"use client"; import type { ReaderSettings } from "@/lib/reader-store"; export type ReaderTheme = { bg: string; text: string; heading: string; muted: string; accent: string; border: string; chrome: string; chromeBorder: string; }; const FONT_LABELS: Record = { 1: "XS", 2: "S", 3: "M", 4: "L", 5: "XL" }; type Props = { settings: ReaderSettings; open: boolean; onClose: () => void; onChange: (patch: Partial) => void; t: ReaderTheme; fontFamily: string; }; const THEMES: { key: ReaderSettings["theme"]; label: string; bg: string; fg: string }[] = [ { key: "night", label: "Night", bg: "#1c1510", fg: "#e8dcc8" }, { key: "parchment", label: "Parchment", bg: "#f4e9d0", fg: "#2c1a0e" }, { key: "paper", label: "Paper", bg: "#fafafa", fg: "#1a1a1a" }, ]; export function ReaderSettingsPanel({ settings, open, onClose, onChange, t, fontFamily }: Props) { function optBtn(active: boolean) { return { display: "flex", alignItems: "center", justifyContent: "center", minHeight: "2.75rem", padding: "0 0.875rem", borderRadius: "0.625rem", border: `1px solid ${active ? t.accent : t.border}`, background: active ? `${t.accent}22` : "transparent", color: active ? t.accent : t.muted, fontFamily, fontSize: "0.8rem", fontWeight: active ? 700 : 400, cursor: "pointer", transition: "all 0.15s", } as React.CSSProperties; } return ( <> {open && (
)} ); }